package com.jiazhong.mingxing.boot.boot03.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

// 我返回的不再是页面路径了，而是数据
@RestController
@RequestMapping("/second")
public class SecondController {
    // get:查询
    // post:添加和涉密查询
    // put:修改
    // delete:删除
    @RequestMapping(value = "/find", method = RequestMethod.GET)
    public String find() {
        return "你查询的结果是：张三吃了面！";
    }

    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public String save() {
        return "执行了添加操作";
    }

    @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
    public String delete() {
        return "用户执行了删除操作";
    }

    @RequestMapping(value = "update", method = RequestMethod.PUT)
    public String update() {
        return "用户执行了修改操作";
    }
}
